<template>
	<view class="content">
		<classf-list ref="classfListRef" @itemClick="cateItemClick"></classf-list>
		<Tabbar :current-page="1"></Tabbar>
	</view>
</template>
<script setup>
	import {
		onLoad,
		onShow
	} from "@dcloudio/uni-app";
	import {
		ref,
		reactive,
		onMounted
	} from 'vue';
	import {
		arrayGet,
		goNav,
		pageUrl
	} from "../../utils/common";
	import {
		classfList
	} from "@/components/cc-defineCateList.vue";
	const classfListRef = ref(null)
	const type = ref('')
	const cateItemClick = (e) => {
		goNav(`${pageUrl.common.pageDetailUrl}?id=${e.id}`)
	}
	onMounted(() => {
		init()
	})
	onShow(() => {
		if (classfListRef.value) {
			type.value = '';
			init()
		}
	})
	onLoad((e) => {
		if (e.tag) {
			type.value = e.tag
		}
	})
	const init = () => {
		classfListRef.value.getData(type.value)
	}
</script>
<style lang="scss" scoped>
	.article-box {
		padding: 32rpx 32rpx 0;
	}
</style>